/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.gap.entities;

import com.buanalintas.bynga.entities.MasterUnit;
import com.buanalintas.bynga.entities.MasterUser;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Collection;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.Lob;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author Yunita
 */
@Entity
@Table(name = "gap_transaction_employee")
@XmlRootElement
//@NamedQueries({
//    @NamedQuery(name = "GapTransactionEmployee.findAll", query = "SELECT g FROM GapTransactionEmployee g"),
//    @NamedQuery(name = "GapTransactionEmployee.findBySync", query = "SELECT g FROM GapTransactionEmployee g WHERE g.sync = :sync"),
//    @NamedQuery(name = "GapTransactionEmployee.findByPosId", query = "SELECT g FROM GapTransactionEmployee g WHERE g.posId = :posId"),
//    @NamedQuery(name = "GapTransactionEmployee.findByPosEmployeeName", query = "SELECT g FROM GapTransactionEmployee g WHERE g.posEmployeeName = :posEmployeeName"),
//    @NamedQuery(name = "GapTransactionEmployee.findByPosEmployeeStatus", query = "SELECT g FROM GapTransactionEmployee g WHERE g.posEmployeeStatus = :posEmployeeStatus"),
//    @NamedQuery(name = "GapTransactionEmployee.findByPosDate", query = "SELECT g FROM GapTransactionEmployee g WHERE g.posDate = :posDate"),
//    @NamedQuery(name = "GapTransactionEmployee.findByPosNumber", query = "SELECT g FROM GapTransactionEmployee g WHERE g.posNumber = :posNumber"),
//    @NamedQuery(name = "GapTransactionEmployee.findByPosCodeItem", query = "SELECT g FROM GapTransactionEmployee g WHERE g.posCodeItem = :posCodeItem"),
//    @NamedQuery(name = "GapTransactionEmployee.findByPosItem", query = "SELECT g FROM GapTransactionEmployee g WHERE g.posItem = :posItem"),
//    @NamedQuery(name = "GapTransactionEmployee.findByPosItemPrice", query = "SELECT g FROM GapTransactionEmployee g WHERE g.posItemPrice = :posItemPrice"),
//    @NamedQuery(name = "GapTransactionEmployee.findByPosDiscountNominal", query = "SELECT g FROM GapTransactionEmployee g WHERE g.posDiscountNominal = :posDiscountNominal"),
//    @NamedQuery(name = "GapTransactionEmployee.findByPosPlatform", query = "SELECT g FROM GapTransactionEmployee g WHERE g.posPlatform = :posPlatform"),
//    @NamedQuery(name = "GapTransactionEmployee.findByPosValue", query = "SELECT g FROM GapTransactionEmployee g WHERE g.posValue = :posValue"),
//    @NamedQuery(name = "GapTransactionEmployee.findByPosCurrent", query = "SELECT g FROM GapTransactionEmployee g WHERE g.posCurrent = :posCurrent"),
//    @NamedQuery(name = "GapTransactionEmployee.findByPosLast", query = "SELECT g FROM GapTransactionEmployee g WHERE g.posLast = :posLast"),
//    @NamedQuery(name = "GapTransactionEmployee.findByPosTimestamp", query = "SELECT g FROM GapTransactionEmployee g WHERE g.posTimestamp = :posTimestamp")})
public class GapTransactionEmployee implements Serializable {

    private static final long serialVersionUID = 1L;
    @Column(name = "sync")
    private String sync;
    @Id
    @Basic(optional = false)
    @Column(name = "pos_id")
    private Integer posId;
    @Column(name = "pos_employee_name")
    private String posEmployeeName;
    @Column(name = "pos_employee_status")
    private String posEmployeeStatus;
    @Column(name = "pos_date")
    @Temporal(TemporalType.DATE)
    private Date posDate;
    @Column(name = "pos_number")
    private String posNumber;
    @Column(name = "pos_status")
    private String posStatus;
    @Column(name = "pos_item_name")
    private String posItemName;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Column(name = "pos_item_price")
    private BigDecimal posItemPrice;
    @Column(name = "pos_discount")
    private BigDecimal posDiscount;
    @Column(name = "pos_platform")
    private BigDecimal posPlatform;
    @Column(name = "pos_value")
    private BigDecimal posValue;
    @Column(name = "pos_current")
    private BigDecimal posCurrent;
    @Column(name = "pos_last")
    private BigDecimal posLast;
    @Lob
    @Column(name = "pos_description")
    private String posDescription;
    @Column(name = "pos_timestamp")
    @Temporal(TemporalType.TIMESTAMP)
    private Date posTimestamp;
    @JoinColumn(name = "pos_employee_id", referencedColumnName = "employee_id")
    @ManyToOne
    private GapMasterEmployee posEmployeeId;
    @JoinColumn(name = "pos_user_id", referencedColumnName = "user_id")
    @ManyToOne
    private MasterUser posUserId;
    @JoinColumn(name = "pos_unit_id", referencedColumnName = "unit_id")
    @ManyToOne
    private MasterUnit posUnitId;
    @JoinColumn(name = "pos_item_id", referencedColumnName = "item_id")
    @ManyToOne
    private GapMasterItem posItemId;

    public GapTransactionEmployee() {
    }

    public GapTransactionEmployee(Integer posId) {
        this.posId = posId;
    }

    public String getSync() {
        return sync;
    }

    public void setSync(String sync) {
        this.sync = sync;
    }

    public Integer getPosId() {
        return posId;
    }

    public void setPosId(Integer posId) {
        this.posId = posId;
    }

    public String getPosEmployeeName() {
        return posEmployeeName;
    }

    public void setPosEmployeeName(String posEmployeeName) {
        this.posEmployeeName = posEmployeeName;
    }

    public String getPosEmployeeStatus() {
        return posEmployeeStatus;
    }

    public void setPosEmployeeStatus(String posEmployeeStatus) {
        this.posEmployeeStatus = posEmployeeStatus;
    }

    public Date getPosDate() {
        return posDate;
    }

    public void setPosDate(Date posDate) {
        this.posDate = posDate;
    }

    public String getPosNumber() {
        return posNumber;
    }

    public void setPosNumber(String posNumber) {
        this.posNumber = posNumber;
    }

    public BigDecimal getPosDiscount() {
        return posDiscount;
    }

    public void setPosDiscount(BigDecimal posDiscount) {
        this.posDiscount = posDiscount;
    }

    public GapMasterItem getPosItemId() {
        return posItemId;
    }

    public void setPosItemId(GapMasterItem posItemId) {
        this.posItemId = posItemId;
    }

    public BigDecimal getPosItemPrice() {
        return posItemPrice;
    }

    public void setPosItemPrice(BigDecimal posItemPrice) {
        this.posItemPrice = posItemPrice;
    }

    public BigDecimal getPosPlatform() {
        return posPlatform;
    }

    public void setPosPlatform(BigDecimal posPlatform) {
        this.posPlatform = posPlatform;
    }

    public BigDecimal getPosValue() {
        return posValue;
    }

    public void setPosValue(BigDecimal posValue) {
        this.posValue = posValue;
    }

    public BigDecimal getPosCurrent() {
        return posCurrent;
    }

    public void setPosCurrent(BigDecimal posCurrent) {
        this.posCurrent = posCurrent;
    }

    public BigDecimal getPosLast() {
        return posLast;
    }

    public void setPosLast(BigDecimal posLast) {
        this.posLast = posLast;
    }

    public String getPosDescription() {
        return posDescription;
    }

    public void setPosDescription(String posDescription) {
        this.posDescription = posDescription;
    }

    public Date getPosTimestamp() {
        return posTimestamp;
    }

    public void setPosTimestamp(Date posTimestamp) {
        this.posTimestamp = posTimestamp;
    }

    public GapMasterEmployee getPosEmployeeId() {
        return posEmployeeId;
    }

    public void setPosEmployeeId(GapMasterEmployee posEmployeeId) {
        this.posEmployeeId = posEmployeeId;
    }

    public MasterUser getPosUserId() {
        return posUserId;
    }

    public void setPosUserId(MasterUser posUserId) {
        this.posUserId = posUserId;
    }

    public MasterUnit getPosUnitId() {
        return posUnitId;
    }

    public void setPosUnitId(MasterUnit posUnitId) {
        this.posUnitId = posUnitId;
    }

    public String getPosStatus() {
        return posStatus;
    }

    public void setPosStatus(String posStatus) {
        this.posStatus = posStatus;
    }

    public String getPosItemName() {
        return posItemName;
    }

    public void setPosItemName(String posItemName) {
        this.posItemName = posItemName;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (posId != null ? posId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof GapTransactionEmployee)) {
            return false;
        }
        GapTransactionEmployee other = (GapTransactionEmployee) object;
        if ((this.posId == null && other.posId != null) || (this.posId != null && !this.posId.equals(other.posId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return posNumber;
//        return "com.gap.entities.GapTransactionEmployee[ posId=" + posId + " ]";
    }
}
